package com.ruoyi.web.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.web.mapper.EmailTemplateMapper;
import com.ruoyi.web.domain.EmailTemplate;
import com.ruoyi.web.service.IEmailTemplateService;

/**
 * 邮箱模板Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-01-05
 */
@Service
public class EmailTemplateServiceImpl implements IEmailTemplateService 
{
    @Autowired
    private EmailTemplateMapper emailTemplateMapper;

    /**
     * 查询邮箱模板
     * 
     * @param id 邮箱模板主键
     * @return 邮箱模板
     */
    @Override
    public EmailTemplate selectEmailTemplateById(Long id)
    {
        return emailTemplateMapper.selectEmailTemplateById(id);
    }

    /**
     * 查询邮箱模板列表
     * 
     * @param emailTemplate 邮箱模板
     * @return 邮箱模板
     */
    @Override
    public List<EmailTemplate> selectEmailTemplateList(EmailTemplate emailTemplate)
    {
        return emailTemplateMapper.selectEmailTemplateList(emailTemplate);
    }

    /**
     * 新增邮箱模板
     * 
     * @param emailTemplate 邮箱模板
     * @return 结果
     */
    @Override
    public int insertEmailTemplate(EmailTemplate emailTemplate)
    {
        emailTemplate.setCreateTime(DateUtils.getNowDate());
        return emailTemplateMapper.insertEmailTemplate(emailTemplate);
    }

    /**
     * 修改邮箱模板
     * 
     * @param emailTemplate 邮箱模板
     * @return 结果
     */
    @Override
    public int updateEmailTemplate(EmailTemplate emailTemplate)
    {
        emailTemplate.setUpdateTime(DateUtils.getNowDate());
        return emailTemplateMapper.updateEmailTemplate(emailTemplate);
    }

    /**
     * 批量删除邮箱模板
     * 
     * @param ids 需要删除的邮箱模板主键
     * @return 结果
     */
    @Override
    public int deleteEmailTemplateByIds(Long[] ids)
    {
        return emailTemplateMapper.deleteEmailTemplateByIds(ids);
    }

    /**
     * 删除邮箱模板信息
     * 
     * @param id 邮箱模板主键
     * @return 结果
     */
    @Override
    public int deleteEmailTemplateById(Long id)
    {
        return emailTemplateMapper.deleteEmailTemplateById(id);
    }
}
